<?php
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include 'includes/header.php';


$id = $_GET['id'];
$id_q = mysql_query('SELECT ot,message,date FROM message WHERE id="'.$id.'" AND do="'.$_SESSION['user_info']['user'].'"');
$id_count = mysql_num_rows($id_q);
if($id_count==0){
	header('Location: index.php');
	exit;
}	

	$id_f = mysql_fetch_assoc($id_q);
	mysql_query('UPDATE message SET `read`="1" WHERE id="'.$_GET['id'].'"');
my_header('Казина :: Jwakk');
?>
			
			<div class="line"></div>
			<div class="mainConteiner">
			
			 <?php include 'includes'.DIRECTORY_SEPARATOR.'top.php'; ?>
			<div class="topDelimiter"></div>
			
			<div class="content">
			
			<table cellspacing="0" cellpadding="0" width="100%"><tr>
			
			<td class="Mainmenu" valign="top">
                            <a href="index.php"><div class="manuB">Казина</div></a>
                            <a href="buyCasino.php"><div class="manuB">Купи казино</div></a>
                            <a href="yoursC.php"><div class="manuB">Твои казина</div></a>
                            <a href="fight.php"><div class="manuB">Сбий се</div></a>
                            <a href="work.php"><div class="manuB">Работа</div></a>
                            <a href="zalozi.php"><div class="manuB">Залози</div></a>
                            <a href="coffee.php"><div class="manuB">Градът</div></a>
                            <a href="profile.php?user=<?php echo $_SESSION['user_info']['user']; ?>"><div class="manuB">Профил</div></a>
                            <?php
								$mes_q = mysql_query('SELECT id FROM message WHERE `do`="'.$_SESSION['user_info']['user'].'" AND `read`="0"');
								$mes_n = mysql_num_rows($mes_q);
								echo '<a href="mail.php"><div class="manuOnB">Съобщения ['.$mes_n.']</div></a>';
							?>
                            <a href="index.php?logout"><div class="manuBLogOut">Изход</div></a>

                            <br/>
                            <a href="#"><img alt="Последвайте Jwakk в Facebook" src="img/facebook.png" /></a>
                            <a href="#"><img alt="Последвайте Jwakk в Twitter" src="img/twitter.png" /></a>
                            <a href="#"><img alt="Абонирайте се за RSS емисии" src="img/rss.png" /></a>
                        </td>
				
				<td valign="top">
					<div class="gameBorder">
					<div class="TheGame">
					<div class="gameTitle">Лични съобщения</div>	
					<br/>
					
					<a href="mail.php" class="tab">Входящи</a> <a href="mail.php?send" class="tab">Изпарти</a> 
					<div class="del"></div>
					<div class="casinostat"><a href="#">От: <?php echo $id_f['ot']; ?></a> <span style="float: right;">Пратено на 20,01,2011</span></div><br/>
					<div class="casinostatN">Съобщение: <br/><br/><?php echo $id_f['message']; ?></div>
					<br/><a href="mail.php?send&to=<?php echo $id_f['ot']; ?>" class="but">Отговори на <?php echo $id_f['ot']; ?></a> <a href="mail.php" class="but">Назад</a><br/><br/>
					
					
					</div>
					</div>
					<div class="help"> <a href="#">Помощ</a> | <a href="#">FAQ</a> | <a href="#">Условия</a> | <a href="#">Facebook</a></div>
				</td>
			
			</tr></table>
			
			
			<div class="footer">
				© JwakK.com · Всички права запазени · <a href="#">Условия за ползване</a>
			</div>
			</div>
			</div>
			
			<div class="bottom"></div>
			
			</body>
			</html>